home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Small Eiffel 0.4.8 / lib_std / memory.e < prev    next >
Text File  |  1997-04-13  |  2KB  |  85 lines

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. expanded class MEMORY
  5. --
  6. -- Facilities for tuning up the garbage collection, and
  7. -- everything about memory control.
  8. --
  9.  
  10. inherit PLATFORM;
  11.  
  12. feature -- Status Report :
  13.  
  14.    frozen collecting: BOOLEAN is
  15.       -- Is garbage collection enabled ?
  16.       do
  17.      not_yet_implemented;
  18.       end;
  19.    
  20. feature -- Status setting :
  21.  
  22.    frozen collection_off is
  23.       -- Disable garbage collection.
  24.       do
  25.      not_yet_implemented;
  26.       end;
  27.    
  28.    frozen collection_on is
  29.       -- Enable garbage collection.
  30.       do
  31.      not_yet_implemented;
  32.       end;
  33.  
  34. feature -- Removal :
  35.  
  36.    dispose is
  37.      -- Action to be executed just before garbage collection 
  38.      -- reclaims an object.
  39.       do
  40.       end;
  41.  
  42.    frozen full_collect is
  43.       -- Force a full collection cycle if garbage collection is
  44.       -- enabled; do nothing otherwise.
  45.       do
  46.       end;
  47.  
  48. feature -- The Guru section (low level memory management) :
  49.  
  50.    pointer_size: INTEGER is
  51.       -- The size in number of bytes for a pointer.
  52.       external "CSE"
  53.       end;
  54.  
  55.    malloc(size: INTEGER): POINTER is
  56.       -- Memory allocation of `size' byte.
  57.       require
  58.      size > 0
  59.       external "IC"
  60.       end;
  61.  
  62.    calloc(number_of_objects, size_of_one: INTEGER): POINTER is
  63.       -- Memory allocation of `size' byte.
  64.       require
  65.      number_of_objects > 0;
  66.      size_of_one >= 1
  67.       external "IC"
  68.       end;
  69.  
  70.    realloc(pointer: POINTER; size: INTEGER): POINTER is
  71.      -- Memory re-allocation of `size' byte.
  72.       require
  73.      pointer.is_not_void;
  74.      size > 0
  75.       external "IC"
  76.       end;
  77.  
  78.    free(pointer: POINTER) is
  79.       require
  80.      pointer.is_not_void;
  81.       external "IC"
  82.       end;
  83.  
  84. end -- MEMORY
  85.